package com.yidian.controller.goods;

import com.alibaba.dubbo.config.annotation.Reference;
import com.yidian.server.goods.StockBackService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author whb
 * @create 2021-09-06 11:19
 * @desciption 库存回滚定时任务调度类
 */
@Component
public class SkuTask {
    @Reference
    private StockBackService stockBackService;

    //@Scheduled(cron = "0 * * * * ?")//每分钟执行一次
    @Scheduled(cron = "0 0 * * * ?")//每小时执行一次
    public void skuStockBack(){
        stockBackService.doBack();//执行库存回滚
    }
}
